-- https://www.cnblogs.com/xiii/p/12433798.html
app = LibStub("AceAddon-3.0"):NewAddon("oUF", "AceEvent-3.0")


-- 首次加载插件时
function app:OnInitialize()
    -- self:Print("插件加载!")
end

-- 启用插件时
function app:OnEnable()
    -- 注册事件
    -- 玩家进入世界
    self:RegisterEvent("PLAYER_ENTERING_WORLD", Update)
end

-- 	玩家进入世界
function app:PLAYER_ENTERING_WORLD()
    oUFAlpha()
end



-- 设置头像透明度
function oUFAlpha(alpha,status)
    alpha = alpha or 0
    status = status or false 
    oUF_Player:EnableMouse(status)
    oUF_Player:SetAlpha(alpha)
    oUF_Player.backdrop:SetAlpha(alpha)

    oUF_Pet:EnableMouse(status)
    oUF_Pet:SetAlpha(alpha)

    -- 判断 状态
    if status == false then
        oUF_Player.Health:Hide()
        oUF_Player.Power.backdrop:Hide()
    else
        oUF_Player.Health:Show()
        oUF_Player.Power.backdrop:Show()
    end

end
